/**
 * EBook Organizer
 * 4/30/2010
 * <P>
 * Contains information relevant to a file type in  <code>EBookOrganizer</code>.
 * </P>
 * @version 0.1
 */
public class FileType implements java.io.Serializable, Comparable<FileType> {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5665435011767470926L;
	
	protected String fileType, programPath, additionalCommands;
	
	public FileType(String fileType, String programPath) {
		this.fileType = fileType;
		this.programPath = programPath;
	}
	
	public void setAdditionalCommands(String str) {
		additionalCommands = str;
	}
	
	public String getFileType() {
		return fileType;
	}
	
	public String getProgramPath() {
		return programPath;
	}
	
	public String toString() {
		return fileType;
	}
	
	@Override
	public int compareTo(FileType arg0) {
		return this.toString().compareToIgnoreCase( arg0.toString() );
	}
	
	public String toOpenString( EBook book) {
		String cmdLine = book.getAttributes().type.getProgramPath();
		cmdLine+= " "+book.getFilePath();
		
		return cmdLine;
	}
	
	
}
